package com.xmall.config;

import com.xmall.define.constants.CommonConstants;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.web.http.HeaderHttpSessionIdResolver;

/**
 * Spring Session 配置
 */
@Configuration
public class SessionConfig {

    /**
     * sessionId 从 header 中获取
     */
    @Bean
    public HeaderHttpSessionIdResolver headerHttpSessionIdResolver() {
        return new HeaderHttpSessionIdResolver(CommonConstants.Auth.TOKEN_HEADER);
    }
}
